import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import BaseEntity from "./base";
import { Post } from "./post";

@Entity("attachments")
export class Attachment extends BaseEntity {
  @Column()
  url: string;

  @ManyToOne(() => Post, (post) => post.attachments)
  @JoinColumn()
  post: Post;
}
